The string operation to be performed may result in different outputs, depending on the string length unit that is used for counting the characters.
待执行的字符串操作可能导致不同的输出,取决于计算字符所使用的字符串长度单元。
Recognizing the character as a single, unit as opposed to a sequence of bytes, is a requirement in the case of string manipulations involving multi-byte characters.
将字符看作一个单元而不是一个字节序列,这是进行多字节字符的字符串操作的必要条件。
When supplementary characters are involved, a supplementary is counted as two UTF-16 code units using CODEUNITS16, or one UTF-32 code unit using CODEUNITS32.
使用增补字符时,对于一个增补字符,使用 CODEUNITS16 计算是两个 UTF-16 代码单元,而使用 CODEUNITS32 计算则是一个 UTF-32 代码单元。
应用推荐